package com.gitee.huanminabc.jlambda_sql.base;


import com.gitee.huanminabc.jlambda_sql.warapper.LambdaWrapper;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

public class SqlHelper {

    public  void execute( String sql , Object... args) throws SQLException {

    }

    public <T>  int  execute(LambdaWrapper<T> lambdaWrapper, String sql , Object... args) {
        return 0;

    }


    public <T> T  queryOne(LambdaWrapper<T> lambdaWrapper, String sql, Class<T> cl, Object... args) {
        return  null;
    }

    public  <T> List<T>  queryList(LambdaWrapper<T> lambdaWrapper, String sql, Class<T> cl, Object... args) {
        return  null;
    }


    public <T>    List<Map<String, Object>>  queryMaps(LambdaWrapper<T> lambdaWrapper, String sql, Object... args){
        return  null;
    }

    public <T>  Map<String, Object>  queryMap(LambdaWrapper<T> lambdaWrapper, String sql, Object... args) {
        return  null;
    }

    //这个sql不止是作为更新,也是可以作为插入的,多个sql即可
    //原理就是一个会话将多个sql一次性提交
    public  <T> int[]  batchExecute(LambdaWrapper<T>[] lambdaWrappers, String... sql) {
        return  null;
    }

    //事物
    public  void  executeInTransaction(Function<SqlHelper,Void> function) {

    }

}
